package tests;

import java.util.concurrent.Semaphore;

public class Timeout extends Thread {

	private final Semaphore mutex;
	
	private final long timeout;
	
	public Timeout(long tArg, Semaphore mArg) {
		timeout = tArg;
		mutex = mArg;;
	}
	
	public void run() {
		try {
			Thread.sleep(timeout);

			mutex.release();
			
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		
	}
	
}
